package hngc.com;

import javax.security.auth.login.LoginException;
import java.util.Scanner;

public class Box10 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String address;
        String phone;
        Boolean statu=false;
        Boolean pstatu=false;
        System.out.println("输入地址:");
        address=scanner.nextLine();
        System.out.println("输入手机号:");
        phone=scanner.nextLine();
        try {
            if(phone.length()==11){
                for (int i=0;i<phone.length();i++){
                    char ch;
                    ch=phone.charAt(i);
                    if(ch>='0'&&ch<='9'){
                        pstatu=true;
                    }else {
                        throw new LoginException("电话格式错误");
                    }
                }
            }else {
                pstatu=false;
            }
            if(address.length()>0&&address.length()<=10){
                for (int i=1;i<address.length();i++){
                    char ch;
                    char ch2;
                    ch=address.charAt(0);
                    ch2=address.charAt(i);
                    if(ch>='a'&&ch<='j'||ch>='A'&&ch<='J'){
                        if((ch2>'a'&&ch2<'j')||(ch2>'0'&&ch<'9')||ch2>='A'&&ch2<='J'){
                            statu=true;
                        }
                    }
                }
            }else {
                statu=false;
            }
        }catch (LoginException e){
            System.out.println(e.getMessage());
        }
        if(pstatu==true){
            System.out.println("OK");
        }else {
            System.out.println("OK");
        }
        if(statu==true){
            System.out.println("OK");
        }else {
            System.out.println("OK");
        }
        scanner.close();
    }
}
